// $Id: keydistancehelper.h 54 2004-10-11 15:31:22Z jonas $
#ifndef KEYDISTANCEHELPER_H
#define KEYDISTANCEHELPER_H

/**
 * This class holds data for the routing code in NodeVanilla (or anyone else
 * who whishes to sort Nodes on distance.
 */
class KeyDistanceHelper {
public:
	KeyDistanceHelper(int distance, RoutingEntry *entry) : m_distance(distance), m_entry(entry) {}
	// TODO: Make this work and nuke the SortKeyDistantHelper
	/*bool operator() (KeyDistanceHelper kd1, KeyDistanceHelper kd2) {
		return kd1.m_distance < kd2.m_distance;
	}*/

	unsigned int m_distance;
	RoutingEntry *m_entry;
};

/**
 * @todo Please remove this class by implementing the functionality in the
 * KeyDistanceHelper class.
 * Provides stl containers a way to sort KeyDistanceHelpers.
 */
class SortKeyDistanceHelper {
public:
	bool operator() (KeyDistanceHelper kd1, KeyDistanceHelper kd2) {
		return kd1.m_distance < kd2.m_distance;
	}
};

#endif
